<template>
  <div class="integrated_system">
    <!-- 综合制度 -->
    <h3>综合部制度文件</h3>
    <div class="integrated_system_info">
        <p>
            <span class="integrated_system_name">制度名称：</span>
            <span :class="['integrated_system_value',isJumpLink ? 'active_link' : '']" @click="handleLink">
                {{ integratedSystemData.question | isVal }}
                <van-icon name="share" size="19px" style="vertical-align: middle;" v-if="isJumpLink" />
            </span>
        </p>
        <p>
            <span class="integrated_system_name">制度分级：</span>
            <span class="integrated_system_value">{{ integratedSystemData.customizedInfo.classification | isVal }}</span>
        </p>
        <p>
            <span class="integrated_system_name">制度分类：</span>
            <span class="integrated_system_value">{{ integratedSystemData.level1Title | isVal }}</span>
        </p>
        <p>
            <span class="integrated_system_name">发文文号：</span>
            <span class="integrated_system_value">{{ integratedSystemData.customizedInfo.docNum | isVal }}</span>
        </p>
        <p>
            <span class="integrated_system_name">印发时间：</span>
            <span class="integrated_system_value">{{ integratedSystemData.customizedInfo.publishTime | isVal }}</span>
        </p>
        <p>
            <span class="integrated_system_name">责任人：</span>
            <span class="integrated_system_value">{{ integratedSystemData.customizedInfo.personLiable | isVal }}</span>
        </p>
    </div>
  </div>
</template>

<script>
export default {
    name: 'IntegratedSystem',
    props: ['integratedSystemData'],
    computed: {
        // 是否有跳转链接
        isJumpLink(){
            return this.integratedSystemData.customizedInfo.linkUrl?.length > 0;
        }
    },
    methods: {
        // 点击链接跳转
        handleLink(){
            if(this.isJumpLink){
                location.href = this.integratedSystemData.customizedInfo.linkUrl;
            }
        }
    },
    filters: {
        // 过滤，是否有值
        isVal(val){
            return val && val.length > 0 ? val : "无";
        }
    }
}
</script>

<style>
@import url('~@/assets/css/home/integratedSystem.css');
</style>
